<template>
	<view class="base-info">
		<view class="field-title">
			<text>所在行业</text>
		</view>
		<view class="list">
			<view  class="list-item">
				<input-custom :model="model.registered_capital" name="注册资金"  @inputComplete="(value)=>inputComplete('registered_capital',value)"></input-custom>
			</view>
			<view  class="list-item">
				<input-custom :model="model.founding_time" name="成立时间" inputType="time" @inputComplete="(value)=>inputComplete('founding_time',value)"></input-custom>
			</view>
			<view  class="list-item">
				<input-custom :model="model.company_type" name="企业性质"  dicCode="customer_type" inputType="select" @inputComplete="(value)=>inputComplete('company_type',value,'select')"></input-custom>
			</view>
			<view  class="list-item">
				<input-custom :model="model.is_up" name="是否上市"  :options="isUpList" inputType="select" @inputComplete="(value)=>inputComplete('is_up',value,'select')"></input-custom>
			</view>
			<view  class="list-item">
				<input-custom :model="model.industry_ranking" name="行业排名" dicCode="company_sort" inputType="select" @inputComplete="(value)=>inputComplete('industry_ranking',value,'select')"></input-custom>
			</view>
			<view  class="list-item">
				<input-custom :model="model.company_url" name="公司网址" @inputComplete="(value)=>inputComplete('company_url',value)"></input-custom>
			</view>
			<view  class="list-item">
				<input-custom :model="model.company_description" name="公司介绍" inputType="textarea" @inputComplete="(value)=>inputComplete('company_description',value)"></input-custom>
			</view>
			
			
		</view>
		<view class="field-title">
			<text>历史需求</text>
		</view>
		<view class="list">
			<view  class="list-item">
				<input-custom :model="historyContent.demand_type" name="需求类型" inputType="picker-select" dicCode="demand_type" @inputComplete="(value)=>inputComplete('demand_type',value,'picker-select')"></input-custom>
			</view>
			<view  class="list-item">
				<input-custom :model="historyContent.demand_time" name="需求时间" inputType="time" @inputComplete="(value)=>inputComplete('demand_time',value)"></input-custom>
			</view>
			<view  class="list-item">
				<input-custom :model="historyContent.demand_person" name="需求对接人" @inputComplete="(value)=>inputComplete('demand_person',value)"></input-custom>
			</view>
			<view  class="list-item">
				<input-custom :model="historyContent.people_total" name="活动人数" inputType="number" @inputComplete="(value)=>inputComplete('people_total',value)"></input-custom>
			</view>
			<view  class="list-item">
				<input-custom :model="historyContent.activity_crowd" name="活动人群" @inputComplete="(value)=>inputComplete('activity_crowd',value)"></input-custom>
			</view>
			<view  class="list-item">
				<input-custom :model="historyContent.activity_address" name="活动地点"  @inputComplete="(value)=>inputComplete('activity_address',value)"></input-custom>
			</view>
			<view  class="list-item">
				<input-custom :model="historyContent.activity_journey" name="活动行程" @inputComplete="(value)=>inputComplete('activity_journey',value)"></input-custom>
			</view>
			<view  class="list-item">
				<input-custom :model="historyContent.activity_overview" name="活动基调" @inputComplete="(value)=>inputComplete('activity_overview',value)"></input-custom>
			</view>
			<view  class="list-item">
				<input-custom :model="historyContent.competitor" name="竞争对手" @inputComplete="(value)=>inputComplete('competitor',value)"></input-custom>
			</view>
			<view  class="list-item">
				<input-custom :model="historyContent.procurement_form" name="采购形式" inputType="select" dicCode="procurement_form" @inputComplete="(value)=>inputComplete('procurement_form',value,'select')"></input-custom>
			</view>
			<view  class="list-item">
				<input-custom :model="historyContent.activity_effect" name="活动效果" @inputComplete="(value)=>inputComplete('activity_effect',value)"></input-custom>
			</view>
			<view  class="list-item">
				<input-custom :model="historyContent.opportunity" name="参与机会" inputType="select" :options="chanceList" @inputComplete="(value)=>inputComplete('opportunity',value,'select')"></input-custom>
			</view>
			<view  class="list-item">
				<input-custom :model="historyContent.remark" name="备注/说明" inputType="textarea" @inputComplete="(value)=>inputComplete('remark',value)"></input-custom>
			</view>
			
		</view>
	</view>
</template>

<script>
	import inputCustom from '@/pages-personal/common/inputCustom.vue'
	export default {
		name:'baseInfo',
		components:{
			inputCustom
		},
		props:{
			clientId:{
				type:String,
				required:true
			},
			model:{
				type:Object,
				default:{}
			},
			historyContent:{
				type:Object,
				default:{}
			},
			moduleType:{
				type:String,
				default:'single'
			}
		},
		data(){
			return{
				infoData:{},
				isUpList:[{text:'已上市',value:1},{text:'没上市',value:2}],
				chanceList:[{text:'有机会',value:'有机会'},{text:'没机会',value:'没机会'},{text:'未知',value:'未知'}]
			}
		},
		created(){
			
		},
		methods:{
			inputComplete(key,value,type){
				console.log('complete',type,value)
				if(type == 'select'||type == 'picker-select'){
					this.$set(this.model,key,value['value']);
				}else{
					this.$set(this.model,key,value)
				}
				let data = {
					id:this.clientId,
					[key]:this.model[key]
				}
				let url = '';
				if(this.moduleType == 'all') {
					url = '/api/business/client/handle';
				} else {
					url = '/api/member/business/client/handle';
				}
				this.$http.post(url,data).then((res) => {
					if(res.data.status == 200) {
						
					}
				})
				console.log('complete2222',this.model)
			}
		}
	}
</script>

<style lang="scss" scoped>
	.base-info{
		padding:0rpx 40rpx 42rpx;
	}
	.field-title{
		padding-top:40rpx;
		color: #000000;
		font-size: 28rpx;
		font-weight: $Semibold;
		text-align: center;
		text{
			vertical-align: middle;
		}
		&:before{
			vertical-align: middle;
			margin-right: 10rpx;
			width: 100rpx;
			height: 6rpx;
			content: '1';
			display: inline-block;
			color: transparent;
			background-image: url('/static/personal/text-left.png');
			background-repeat: no-repeat;
			background-size: 100%;
			background-position: center;
		}
		&:after{
			vertical-align: middle;
			margin-left: 10rpx;
			display: inline-block;
			width: 100rpx;
			height: 6rpx;
			content: '1';
			color: transparent;
			background-image: url('/static/personal/text-right.png');
			background-repeat: no-repeat;
			background-size: 100%;
			background-position: 50%;
		}
	}
	.list{
		// margin-bottom: 40rpx;
		.list-item{
			margin-top:60rpx;
		}
	}
</style>